using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Build.Framework;
using Microsoft.EnterpriseSingleSignOn.Interop;

namespace BizTalk.BuildGenerator.Tasks.SSO
{
    /// <summary>
    /// Enable an application from SSO
    /// </summary>
    public class EnableApplication : BaseSSOTask
    {
        private string _ApplicationName;

        /// <summary>
        /// Name of the sso application
        /// </summary>
        [Required]
        public string ApplicationName
        {
            get { return _ApplicationName; }
            set { _ApplicationName = value; }
        }
        /// <summary>
        /// execute task
        /// </summary>
        /// <returns></returns>
        public override bool Execute()
        {           
            string arguments = string.Format("-enableapp {0}", this._ApplicationName);
            base.ExecuteSsoManage(arguments);
            return true;
        }
    }
}
